<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Pragma" content="no-cache"> 
	<meta http-equiv="Cache-Control" content="no-cache"> 
	<meta http-equiv="Expires" content="0"> 
	<title>PCI1714</title>
	<link rel="stylesheet" type="text/css" href="../js/easyui/themes/bootstrap/easyui.css">
	<link rel="stylesheet" type="text/css" href="../js/easyui/themes/icon.css">
	<script type="text/javascript" src="../js/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="../js/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../js/extEasyUI.js?v=201305241044" charset="utf-8"></script>
	<script type="text/javascript" src="../js/extJquery.js?v=201305301341" charset="utf-8"></script>

	
	<script type="text/javascript">
	
		var intv;

		$(function() {
			
			load();
			
			//loadState();
			
			//intv = setInterval(loadState, 5000);
			
		});
		
	
		function save(){
			
			$.messager.progress();
			
			$('#ftype').form('submit', {
				url:'../pcie8622/setConfig.do',
				success: function(){
					$.messager.progress('close');	// hide progress bar while submit successfully
				}
			});
			
		}
		
		function load(){
			
			$.messager.progress();
			$('#ftype').form('load', '../pcie8622/getConfig.do');
			$.messager.progress('close');
			
		}
		
		function loadState() {
			
			$.ajax({ 
		        type: "post", 
                url: '../pcie8622/getPciState.do',
                dataType: "json",
                success: function (data) {
                	$('#state').val(data.state);
                	$('#status').val(data.status);
                },
                error: function () {
                	$('#state').val("UNKNOWN, Refresh error.");
                	$('#status').val("UNKNOWN, Refresh error.");
                }
			});
			
		}
		
	</script>
	
	
</head>
<body>

	<div style="margin:10px 0;"></div>
	
	<div class="easyui-panel" title="配置信息" style="width:600px">
	
		<div style="padding:10px 60px 20px 60px">

		    <form id="ftype" method="post">
		    	<table>
		    		<tr>
		    			<td>设备逻辑号:</td>
		    			<td>
		    				<input name="logicId" type="text" value="">
						</td>
		    		</tr>		    		
		    		<tr>
		    			<td>起始通道:</td>
		    			<td>
		    				<input name="channelFirst" type="text" value="">
						</td>
		    		</tr>
		    		<tr>
		    			<td>结束通道:</td>
		    			<td>
		    				<input name="channelLast" type="text" value="">
						</td>
		    		</tr>		    				    		
		    		<tr>
		    			<td>采样模式:</td>
		    			<td>
		    				<select name="adMode" class="easyui-combobox">
		    				    <option value="0">连续采集</option>
							    <option value="1">分组采集</option>
							</select>
						</td>
		    		</tr>
					<tr>
		    			<td>组间间隔:</td>
		    			<td>
		    				<input name="groupInterval" type="text" value="">
						</td>
		    		</tr>
					<tr>
		    			<td>组内循环:</td>
		    			<td>
		    				<input name="groupLoops" type="text" value="">
						</td>
		    		</tr>		    		
		    		<tr>
		    			<td>增益:</td>
		    			<td>
		    				<select name="gains" class="easyui-combobox">
		    				    <option value="0">1倍增益</option>
							    <option value="1">2倍增益</option>
		    				    <option value="2">4倍增益</option>
							    <option value="3">8倍增益</option>							    
							</select>
						</td>
		    		</tr>
		    		<tr>
		    			<td>触发模式:</td>
		    			<td>
		    				<select name="trigerMode" class="easyui-combobox">
		    				    <option value="0">软件触发(内触发)</option>
							    <option value="1">硬件触发(外触发)</option>						    
							</select>
						</td>
		    		</tr>	
		    		<tr>
		    			<td>触发源:</td>
		    			<td>
		    				<select name="trigerSource" class="easyui-combobox">
		    				    <option value="1">ATR</option>
							    <option value="2">DTR</option>						    
							</select>
						</td>
		    		</tr>	
		    		<tr>
		    			<td>触发类型:</td>
		    			<td>
		    				<select name="trigerType" class="easyui-combobox">
		    				    <option value="0">边缘触发</option>
							    <option value="1">电平触发</option>						    
							</select>
						</td>
		    		</tr>	
		    		<tr>
		    			<td>触发方向:</td>
		    			<td>
		    				<select name="trigerDir" class="easyui-combobox">
		    				    <option value="0">负向触发(低脉冲/下降沿触发)</option>
							    <option value="1">正向触发(高脉冲/上升沿触发)</option>
							    <option value="2">正负方向均有效</option>						    
							</select>
						</td>
		    		</tr>	
		    		<tr>
		    			<td>时钟源:</td>
		    			<td>
		    				<select name="clockSource" class="easyui-combobox">
		    				    <option value="0">内部时钟</option>
							    <option value="1">外部时钟</option>					    
							</select>
						</td>
		    		</tr>	
		    		<tr>
		    			<td>时钟输出:</td>
		    			<td>
		    				<select name="clockOutput" class="easyui-combobox">
		    				    <option value="0">禁止</option>
							    <option value="1">允许</option>					    
							</select>
						</td>
		    		</tr>	
		    		<tr>
		    			<td>接地类型:</td>
		    			<td>
		    				<select name="groundingMode" class="easyui-combobox">
		    				    <option value="0">单端方式</option>
							    <option value="1">双端方式</option>					    
							</select>
						</td>
		    		</tr>	
		    		<tr>
		    			<td>采样频率:</td>
		    			<td>
		    				<select name="frequency" class="easyui-combobox">
		    				    <option value="500000">500 KHz</option>
							    <option value="250000">250 KHz</option>	
							    <option value="125000">125 KHz</option>	
							    <option value="100000">100 KHz</option>	
							    <option value="50000">50 KHz</option>	
							    <option value="25000">25 KHz</option>					    
							</select>
						</td>
		    		</tr>	
		    		<tr>
		    			<td>输入量程:</td>
		    			<td>
		    				<select name="inputRange" class="easyui-combobox">
		    				    <option value="0">±10000mV</option>
							    <option value="1">±5000mV</option>	
							    <option value="2">±2500mV</option>		
							    <option value="3">0~10000mV</option>		
							    <option value="4">0~5000mV</option>					    
							</select>
						</td>
		    		</tr>
					<tr>
		    			<td>触发电平:</td>
		    			<td>
		    				<input name="trigLevelVolt" type="text" value="">
						</td>
		    		</tr>	
		    		<tr>
		    			<td>接收模式:</td>
		    			<td>
		    				<select name="receiveMode" class="easyui-combobox">
		    					<option value="0">非空方式接收</option>
		    				    <option value="1">半满方式接收</option>
							</select>
						</td>
		    		</tr>
					<tr>
		    			<td>接收间隔:</td>
		    			<td>
		    				<input name="receiveInterval" type="text" value="">
						</td>
		    		</tr>		    			    			    				    				    						    		
		    	</table>
		    </form>
	    
	    </div>
	    
	    <div style="padding:10px 60px 10px 60px">
		
			<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" style="width:80px" onclick="save()">应用</a>
			<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-no'" style="width:80px" onclick="load()">刷新</a>
			
		</div>	
	    
	</div>	
	
	<div class="easyui-panel" title="运行状态" style="width:600px">
		
		<div style="margin:10px 10px;">
		
		<p>运行状态：</p>
		
		<input id="state" type="text" value="" disabled="disabled" style="width:100%">
		
		</div>
		
		<div style="margin:10px 10px;">
		
		<p>状态描述：</p>
		
		<input id="status" type="text" value="" disabled="disabled" style="width:100%">
			    
		</div>
		
		<div style="padding:10px 60px 10px 60px">
		
			<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-no'" style="width:80px" onclick="loadState()">刷新</a>
			
		</div>
		
	</div>	


</body>
</html>